/*
 * @lc app=leetcode.cn id=171 lang=cpp
 *
 * [171] Excel 表列序号
 */

#include <limits.h>

#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

// @lc code=start
class Solution {
public:
    int titleToNumber(string columnTitle) {
        int result = 0;

        for (char c: columnTitle) {
            int number = c - 'A' + 1;
            result = result * 26 + number;
        }
        
        return result;
    }
};
// @lc code=end

